<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
        <title>Form</title>
        <meta http-equiv="content-type" content="text/html; charset=UTF-8" />
        <link href="/sap/demo.css" rel="stylesheet" type="text/css" />
        <script src="/sap/scripts/boot.js" type="text/javascript"></script>
    </head>
    <style>

        td{
            margin-top:10px;

        }
    </style>
    <body>

    <div id="grid1" class="mini-datagrid" style="width:100%;height:550px;"
         url="/SapSupplier/permissionmaolidata/timeTagStart/<?php echo $timeTagStart;?>/timeTagComplete/<?php echo $timeTagComplete;?>" idField="id"
         allowResize="true" showFilterRow="true" pageSize="50"
         allowCellEdit="true" allowCellSelect="true" multiSelect="true"
         editNextOnEnterKey="true">

            <div property="columns">

            <div header="订单号" field="FreeTxt" width="80px">
                <input id="FreeTxtFilter" property="filter"  class="mini-textbox" style="width:100%;" onvaluechanged="onFilterChanged"/>
            </div>
            <div header="平台编号" field="CardCode"  width="80px">
                <input id="CardCodeFilter" property="filter"  class="mini-textbox" style="width:100%;" onvaluechanged="onFilterChanged"/>
            </div>
            <div header="单据日期" field="DocDate"  width="200px">
                <input id="DocDateFilter"  class="mini-textbox" style="width:100%;" onvaluechanged="onFilterChanged"/>
            </div>
            <div header="物料号" field="ITEMCODE"  width="50px">
                <input id="ITEMCODEFilter" property="filter"  class="mini-textbox" style="width:100%;" onvaluechanged="onFilterChanged"/>
            </div>
            <div header="物料名" field="ITEMNAME"  width="150px">
                <input id="ITEMNAMEFilter"  property="filter"  class="mini-textbox" style="width:100%;" onvaluechanged="onFilterChanged"/>
            </div>
            <div header="数量" field="Quantity"  width="200px">
                <input id="QuantityFilter"  class="mini-textbox" style="width:100%;" onvaluechanged="onFilterChanged"/>
            </div>

            <div header="单价" field="Price" width="80px">
                <input id="PriceFilter"  class="mini-textbox" style="width:100%;" onvaluechanged="onFilterChanged"/>
            </div>
            <div header="小计" field="linetotal"  width="80px">
                <input id="linetotalFilter"  class="mini-textbox" style="width:100%;" onvaluechanged="onFilterChanged"/>
            </div>
            <div header="成本" field="StockPrice"  width="200px">
                <input id="StockPriceFilter"  class="mini-textbox" style="width:100%;" onvaluechanged="onFilterChanged"/>
            </div>
            <div header="成本小计" field="LineStockPrice"  width="50px">
                <input id="LineStockPriceFilter"  class="mini-textbox" style="width:100%;" onvaluechanged="onFilterChanged"/>
            </div>
            <div header="银行费用" field="bankcharge"  width="200px">
                <input id="bankchargeFilter"  class="mini-textbox" style="width:100%;" onvaluechanged="onFilterChanged"/>
            </div>

            <div header="预估运费" field="EstimateExpCost" width="80px">
                <input id="EstimateExpCostFilter"  class="mini-textbox" style="width:100%;" onvaluechanged="onFilterChanged"/>
            </div>
            <div header="结算运费" field="TureExpCost"  width="80px">
                <input id="TureExpCostFilter"  class="mini-textbox" style="width:100%;" onvaluechanged="onFilterChanged"/>
            </div>
            <div header="赠品数" field="giftcount"  width="200px">
                <input id="giftcountFilter"  class="mini-textbox" style="width:100%;" onvaluechanged="onFilterChanged"/>
            </div>
            <div header="赠品价值" field="giftprice"  width="50px">
                <input id="giftpriceFilter"  class="mini-textbox" style="width:100%;" onvaluechanged="onFilterChanged"/>
            </div>
            <div header="赠品种类" field="giftkind"  width="200px">
                <input id="giftkindFilter"  class="mini-textbox" style="width:100%;" onvaluechanged="onFilterChanged"/>
            </div>

            <div header="赠品运费" field="giftaddexpressfee" width="80px">
                <input id="giftaddexpressfeeFilter"  class="mini-textbox" style="width:100%;" onvaluechanged="onFilterChanged"/>
            </div>
            <div header="产品经理" field="Pmanager"  width="80px">
                <input id="PmanagerFilter" class="mini-textbox" style="width:100%;" onvaluechanged="onFilterChanged"/>
            </div>
            <div header="代发" field="isBehalf"  width="200px">
                <input id="isBehalfFilter" class="mini-textbox" style="width:100%;" onvaluechanged="onFilterChanged"/>
            </div>
            <div header="计数运费" field="calcexpressfee"  width="50px">
                <input id="calcexpressfeeFilter"  class="mini-textbox" style="width:100%;" onvaluechanged="onFilterChanged"/>
            </div>
            <div header="物流附加" field="addexpressfee"  width="200px">
                <input id="addexpressfeeFilter"  class="mini-textbox" style="width:100%;" onvaluechanged="onFilterChanged"/>
            </div>

            <div header="计算成本" field="calclineStockprice" width="80px">
                <input id="calclineStockpriceFilter"  class="mini-textbox" style="width:100%;" onvaluechanged="onFilterChanged"/>
            </div>
            <div header="计算税" field="calctax"  width="80px">
                <input id="calctaxFilter" class="mini-textbox" style="width:100%;" onvaluechanged="onFilterChanged"/>
            </div>
            <div header="产品组长" field="Pleader"  width="200px">
                <input id="PleaderFilter" class="mini-textbox" style="width:100%;" onvaluechanged="onFilterChanged"/>
            </div>
            <div header="是否预估手续费" field="IsEstimateBankFee"  width="50px">
                <input id="IsEstimateBankFeeFilter"  class="mini-textbox" style="width:100%;" onvaluechanged="onFilterChanged"/>
            </div>

        </div>


    </div>

    <script type="text/javascript">
        mini.parse();
        var grid1 = mini.get("grid1");
        grid1.load();

        //绘制表格
        grid1.on("drawcell", function (e) {

            var record = e.record,
                column = e.column,
                field = e.field,
                value = e.value;

            //格式化日期
            if (field == "DocDate" ) {
                if (mini.isDate(value)) e.cellHtml = mini.formatDate(value, "yyyy-MM-dd HH:mm:ss");
            }

        });

    </script>

    <script type="text/javascript">

        function onFilterChanged(e) {

            var FreeTxtBox = mini.get("FreeTxtFilter");
            var CardCodeBox = mini.get("CardCodeFilter");
            var ITEMCODEBox = mini.get("ITEMCODEFilter");
            var ITEMNAMEBox = mini.get("ITEMNAMEFilter");

            var FreeTxt = FreeTxtBox.getValue().toLowerCase();
            var CardCode = CardCodeBox.getValue().toLowerCase();
            var ITEMCODE = ITEMCODEBox.getValue().toLowerCase();
            var ITEMNAME = ITEMNAMEBox.getValue().toLowerCase();

            //多条件组合过滤
            grid1.filter(function (row) {

                var r_FreeTxt = true;
                if (FreeTxt) {
                    r_FreeTxt = String(row.FreeTxt).toLowerCase().indexOf(FreeTxt) != -1;
                }

                var r_CardCode = true;
                if (CardCode) {
                    r_CardCode = String(row.CardCode).toLowerCase().indexOf(CardCode) != -1;
                }

                var r_ITEMNAME = true;
                if (ITEMNAME) {
                    r_ITEMNAME = String(row.ITEMNAME).toLowerCase().indexOf(ITEMNAME) != -1;
                }

                var r_ITEMCODE = true;
                if (ITEMCODE) {
                    r_ITEMCODE = String(row.ITEMCODE).toLowerCase().indexOf(ITEMCODE) != -1;
                }

                return r_FreeTxt && r_CardCode && r_ITEMNAME && r_ITEMCODE;
            });
        }

    </script>

    </body>
    </html>